package com.tuanbiao.models.action;

import com.hzjq.data.entity.BlastEntity;
import com.hzjq.lib.BlastKool;
import com.tuanbiao.data.callback.OnBaseResultCallback;

import java.util.List;

/**
 * @author abiao
 * @since 2022/4/29 11:18
 */
public interface BlastCopyAction {
    default void queryBlastCopy(int pageIndex, OnBaseResultCallback<List<BlastEntity>> callback) {
        BlastKool.Companion.loader().db().queryBlastCopy(pageIndex, blastEntities -> {
            callback.onSuccess(blastEntities);
            callback.onFinish();
        });
    }

    default void deleteBlastCopy(BlastEntity entity, OnBaseResultCallback<Void> callback) {
        BlastKool.Companion.loader().db().deleteBlastCopy(entity, () -> {
            callback.onSuccess(null);
            callback.onFinish();
        });
    }

    default void restoreBlastCopy(BlastEntity entity, OnBaseResultCallback<Void> callback) {
        BlastKool.Companion.loader().db().restoreBlastCopy(entity, () -> {
            callback.onSuccess(null);
            callback.onFinish();
        });
    }
}
